Reject legend_loc='on data' loudly in pl.show()#649
Merged
Conversation
Closes #624. 'on data' requires scatter embedding coordinates, which do not exist for any spatialdata-plot render type. Previously crashed deep in scanpy with 'Grouper and axis must be same length' (categorical) or warned and fell back (channel legend). Now raises a clear ValueError at the API surface and the obsolete channel-legend fallback is removed.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #649 +/- ##
==========================================
+ Coverage 76.86% 76.88% +0.02%
==========================================
Files 11 11
Lines 3276 3275 -1
Branches 773 773
==========================================
Hits 2518 2518
+ Misses 458 457 -1
Partials 300 300
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
legend_loc="on data"is meaningless in spatialdata-plot — there are no scatter embedding coordinates for shapes, points, labels, or image channels. It previously crashed deep in scanpy withValueError: Grouper and axis must be same length(categorical path) or warned and fell back (channel-legend path).pl.show()now raises a clearValueErrorat the API surface, after thelegend_paramsdict override resolves the finallegend_loc, so all entry paths are covered._draw_channel_legendis removed.